<?php
namespace app\common\validate;
use think\Validate;

class User extends Validate
{
	protected $rule =   [
		'username'		=> 'require|min:6|max:32',
		'password'		=> 'require|min:6|max:32|confirm',
		'phone'			=> 'mobile',
		'email'			=> 'email',
		'qq'			=> 'min:5|max:12',
		'wechat'		=> 'min:6|max:32',
		'desc'			=> 'max:255',
	];
	
	protected $message  =   [
		'username.require'		=> '帐号必须填写',
		'username.min'			=> '帐号长度至少需要6位',
		'username.max'			=> '帐号长度不得超过32位',
		'password.require'		=> '密码必须填写',
		'password.min'			=> '密码长度至少需要6位',
		'password.max'			=> '密码长度不得超过32位',
		'password.confirm'		=> '2次输入的密码不一致',
		'phone.mobile'			=> '手机号码格式错误',
		'email.email'			=> '邮箱格式错误',
		'qq.min'				=> 'QQ号长度至少需要5位',
		'qq.max'				=> 'QQ号长度不得超过12位',
		'wechat.min'			=> '微信号长度至少需要6位',
		'wechat.max'			=> '微信号长度不得超过32位',
		'desc.max'				=> '个人签名长度最多255位',
	];
}